#include "pch.h"
#include "KLine.h"

KLine::KLine(float high, float low, float close, float open) {
	m_high = high;
	m_low = low;
	m_close = close;
	m_open = open;
	m_isApex = false;
	m_isButtom = false;

	if (close > open) {
		m_type = KLineTypeEnum::PositiveLine;
	}
	else if (close < open) {
		m_type = KLineTypeEnum::NegativeLine;
	}
	else {
		m_type = KLineTypeEnum::CrossLine;
	}
}

bool KLine::isPoint() {
	return (m_isApex || m_isButtom);
}

void KLine::setApex() {
	this->m_isApex = true;
	this->m_isButtom = false;
}

void KLine::setButtom() {
	this->m_isApex = false;
	this->m_isButtom = true;
}

void KLine::setNotPoint() {
	this->m_isApex = false;
	this->m_isButtom = false;
}

